<template>
  <main class="pug-pro-basicLayout-content pug-pro-basicLayout-has-header">
    <div class="pug-pro-page-container">
      <div class="pug-pro-page-container-warp">
        <div class="pug-page-header has-breadcrumb">
          <div class="pug-page-header-heading">
            <div class="pug-page-header-heading-left">
              <span class="pug-page-header-heading-title" title="分步表单">{{ opid ? '修改产品' : "添加产品" }}</span>
              编辑的id是:{{ opid }}
            </div>
          </div>
          <div class="pug-page-header-content">
            <div class="pug-pro-page-container-detail">
              <div class="pug-pro-page-container-main">
                <div class="pug-pro-page-container-row">
                  <div class="pug-pro-page-container-content">
                    酒店订单页用于向用户收集或验证信息，分步酒店订单常见于数据项较多的表单场景。
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="pug-pro-grid-content">
        <div class="pug-pro-grid-content-children">
          <div class="pug-pro-layout-watermark-wrapper" style="position: relative;">
            <div class="pug-pro-page-container-children-content">
              <div class="pug-card">
                <div class="pug-pro-steps-form-steps-container" style="max-width: 760px;padding: 20px 0">
                  <div class="pug-steps pug-steps-horizontal pug-steps-label-horizontal">
                    <div class="pug-steps-item" @click="next(1)"
                         :class="[currentStep>=1?'pug-steps-item-process pug-steps-item-active':'']">
                      <div class="pug-steps-item-container">
                        <div class="pug-steps-item-tail"></div>
                        <div class="pug-steps-item-icon"><span class="pug-steps-icon">1</span></div>
                        <div class="pug-steps-item-content">
                          <div class="pug-steps-item-title">基本信息</div>
                        </div>
                      </div>
                    </div>
                    <div class="pug-steps-item pug-steps-item-wait" @click="next(2)"
                         :class="[currentStep>=2?'pug-steps-item-process pug-steps-item-active':'']">
                      <div class="pug-steps-item-container">
                        <div class="pug-steps-item-tail"></div>
                        <div class="pug-steps-item-icon"><span class="pug-steps-icon">2</span></div>
                        <div class="pug-steps-item-content">
                          <div class="pug-steps-item-title">明细控制</div>
                        </div>
                      </div>
                    </div>
                    <div class="pug-steps-item pug-steps-item-wait" @click="next(3)"
                         :class="[currentStep>=3?'pug-steps-item-process pug-steps-item-active':'']">
                      <div class="pug-steps-item-container">
                        <div class="pug-steps-item-tail"></div>
                        <div class="pug-steps-item-icon"><span class="pug-steps-icon">3</span></div>
                        <div class="pug-steps-item-content">
                          <div class="pug-steps-item-title">价格控制</div>
                        </div>
                      </div>
                    </div>
                    <div class="pug-steps-item pug-steps-item-wait" @click="next(4)"
                         :class="[currentStep>=4?'pug-steps-item-process pug-steps-item-active':'']">
                      <div class="pug-steps-item-container">
                        <div class="pug-steps-item-tail"></div>
                        <div class="pug-steps-item-icon"><span class="pug-steps-icon">4</span></div>
                        <div class="pug-steps-item-content">
                          <div class="pug-steps-item-title">产品描述</div>
                        </div>
                      </div>
                    </div>
                    <div class="pug-steps-item pug-steps-item-wait" @click="next(5)"
                         :class="[currentStep>=5?'pug-steps-item-process pug-steps-item-active':'']">
                      <div class="pug-steps-item-container">
                        <div class="pug-steps-item-tail"></div>
                        <div class="pug-steps-item-icon"><span class="pug-steps-icon">5</span></div>
                        <div class="pug-steps-item-content">
                          <div class="pug-steps-item-title">发布完成</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div v-show="currentStep==1" class="pug-card mt20">
                <div class="pug-card-body">
                  <div class="pug-debug-result">{{orderhotel}}</div>
                  <div class="pug-row" style="justify-content: center">

                    <div class="pug-col pug-col-lg-8" style="padding:0 30px;">
                      <div autocomplete="off" class="pug-form pug-form-vertical pug-form-hide-required-mark">
                         <input type="hidden" v-model="orderhotel.id" cref="id"/>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="订单编号 微信支付和阿里支付 用来退款">订单编号 微信支付和阿里支付 用来退款
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入订单编号 微信支付和阿里支付 用来退款" cref="orderno" maxlen="100"  v-model="orderhotel.orderno" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="下单用户id">下单用户id
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入下单用户id" cref="userId" maxlen="20"  v-model="orderhotel.userId" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="下单用户的昵称">下单用户的昵称
                                <span class='pug-valid-label'>(*必填)</span>
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入下单用户的昵称" cref="nickname" maxlen="100"  v-model="orderhotel.nickname" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="下单用户的头像">下单用户的头像
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                              <div class="pug-form-item-control-input-content">
                                <span class="pug-input-affix-wrapper pro-field pro-field-md">
                                    <input  placeholder="请上传下单用户的头像" id="avatar" class="pug-input" type="text" v-model="orderhotel.avatar"/>
                                    <pug-upload @callback="uploadSuccess" cref="avatar" v-model="orderhotel.avatar"></pug-upload>
                                </span>
                              </div>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="订单状态 -1 失效的订单 0 未支付的订单 1 已支付 2已完成">订单状态 -1 失效的订单 0 未支付的订单 1 已支付 2已完成
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                              <pug-radio v-model="orderhotel.status" cref="status" :items='[{text:"是",value:1},{text:"否",value:0}]' :is-value="false"></pug-radio>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="下单金额">下单金额
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入下单金额" cref="paymoney" maxlen="20"  v-model="orderhotel.paymoney" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店id">酒店id
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店id" cref="hotelId" maxlen="20"  v-model="orderhotel.hotelId" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店封面">酒店封面
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店封面" cref="hotelImg" maxlen="200"  v-model="orderhotel.hotelImg" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店标题">酒店标题
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店标题" cref="hotelTitle" maxlen="100"  v-model="orderhotel.hotelTitle" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店描述">酒店描述
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店描述" cref="hotelDesc" maxlen="200"  v-model="orderhotel.hotelDesc" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店房型标题">酒店房型标题
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店房型标题" cref="hotelDetailTitle" maxlen="100"  v-model="orderhotel.hotelDetailTitle" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店房型图标">酒店房型图标
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店房型图标" cref="hotelDetailImg" maxlen="200"  v-model="orderhotel.hotelDetailImg" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店房型id">酒店房型id
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店房型id" cref="hotelDetailId" maxlen="20"  v-model="orderhotel.hotelDetailId" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="交易号，微信支付和阿里支付 方便退款">交易号，微信支付和阿里支付 方便退款
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入交易号，微信支付和阿里支付 方便退款" cref="tradeno" maxlen="60"  v-model="orderhotel.tradeno" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="单金额">单金额
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入单金额" cref="openid" maxlen="60"  v-model="orderhotel.openid" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="支付IP地址">支付IP地址
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入支付IP地址" cref="ip" maxlen="20"  v-model="orderhotel.ip" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="支付用户的IP具体地址">支付用户的IP具体地址
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入支付用户的IP具体地址" cref="ipaddress" maxlen="200"  v-model="orderhotel.ipaddress" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="支付方式 1 微信支付 2 支付支付 3 待定">支付方式 1 微信支付 2 支付支付 3 待定
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                              <pug-radio v-model="orderhotel.paytype" cref="paytype" :items='[{text:"是",value:1},{text:"否",value:0}]' :is-value="false"></pug-radio>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店地址">酒店地址
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店地址" cref="hotelAddress" maxlen="100"  v-model="orderhotel.hotelAddress" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店联系方式">酒店联系方式
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店联系方式" cref="hotelTel" maxlen="50"  v-model="orderhotel.hotelTel" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店经度">酒店经度
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店经度" cref="hotelLgt" maxlen="20"  v-model="orderhotel.hotelLgt" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="酒店纬度">酒店纬度
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                                 <pug-input  placeholder="请输入酒店纬度" cref="hotelLan" maxlen="20"  v-model="orderhotel.hotelLan" type="text"></pug-input>
                            </div>
                            </div>
                          </div>
                        </div>
                         <div class="pug-row pug-form-item" style="row-gap: 0px;">
                          <div class="pug-col pug-form-item-label">
                             <label class="pug-form-item-required" title="">
                             </label>
                          </div>
                          <div class="pug-col pug-form-item-control">
                            <div class="pug-form-item-control-input">
                             <div class="pug-form-item-control-input-content">
                              <pug-radio v-model="orderhotel.isdelete" cref="isdelete" :items='[{text:"不删除",value:0},{text:"删除",value:1}]' :is-value="false"></pug-radio>
                            </div>
                            </div>
                          </div>
                        </div>
                        <!--保存和下一步按钮-->
                        <div class="pug-space pug-space-horizontal pug-space-align-center"
                             style="flex-wrap: wrap; gap: 8px;">
                          <div class="pug-space-item" style="">
                             <router-link to="/orderhotel"><button  class="pug-btn pug-btn-primary mr10"><span><i class="iconfont icon-icon_arrow_left pr3 fz13"></i>返回</span></button></router-link>
                             <button type="button" v-if="!orderhotel.id" class="pug-btn pug-btn-primary mr3" @click="saveorupdate()"><span><i class="iconfont icon-tianjia pr3"></i>保存</span></button>
                             <button type="button" v-if="orderhotel.id" class="pug-btn pug-btn-primary mr3" @click="saveorupdate()"><span><i class="iconfont icon-quanbudingdan pr3"></i>编辑</span></button>
                           </div>
                          <div class="pug-space-item" style="">
                            <button type="button" class="pug-btn" @click="next(2)"><span>下一步</span>
                            </button>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
             <div v-show="currentStep==2" class="pug-card mt20">
              2
             </div>
             <div v-show="currentStep==3" class="pug-card mt20">
              3
             </div>
             <div v-show="currentStep==4" class="pug-card mt20">
              4
             </div>
             <div v-show="currentStep==5" class="pug-card mt20">
               5
             </div>
         </div>
       </div>
     </div>
   </div>
 </div>
</main>
</template>
<script>
import orderhotelService from '@/services/orderhotel'
import pugDialog from "@/plugins/PugDialog";
import pugMessage from "@/plugins/PugMessage";
import {isEmpty,getById,isNotEmpty} from "@/utils/validate";
import cache from "@/utils/cache"
export default {
  name: "OrderHotelAdd.vue",
  components: {},
  data() {
    return {
      opid: "",
      orderhotel:{
        id:"", // 主健
        orderno:"", // 订单编号 微信支付和阿里支付 用来退款
        userId:"", // 下单用户id
        nickname:"", // 下单用户的昵称
        avatar:"", // 下单用户的头像
        status:1 , // 订单状态 -1 失效的订单 0 未支付的订单 1 已支付 2已完成
        paymoney:"", // 下单金额
        hotelId:"", // 酒店id
        hotelImg:"", // 酒店封面
        hotelTitle:"", // 酒店标题
        hotelDesc:"", // 酒店描述
        hotelDetailTitle:"", // 酒店房型标题
        hotelDetailImg:"", // 酒店房型图标
        hotelDetailId:"", // 酒店房型id
        tradeno:"", // 交易号，微信支付和阿里支付 方便退款
        openid:"", // 单金额
        ip:"", // 支付IP地址
        ipaddress:"", // 支付用户的IP具体地址
        paytype:"", // 支付方式 1 微信支付 2 支付支付 3 待定
        hotelAddress:"", // 酒店地址
        hotelTel:"", // 酒店联系方式
        hotelLgt:"", // 酒店经度
        hotelLan:"", // 酒店纬度
        isdelete:0  //
      },

      currentStep: 1,
      steps: [1, 2, 3]
    }
  },

  created() {

    // 根据id酒店订单明细
    if(!isEmpty(this.$route.params.id)){
      this.orderhotel.id = this.$route.params.id;
      this.opid = this.$route.params.id;
      // 加载明细
      this.getDetail();
    }else{
      if(isNotEmpty(cache.local.get("orderhotel_save"))) {
        this.orderhotel = cache.local.getJSON("orderhotel_save")
      }
    }
  },

   watch:{
      orderhotel:{
        deep:true,
        handler(val,newval){
          cache.local.setJSON("orderhotel_save",newval);
        }
      }
   },

  methods: {

    // 加载明细
    async getDetail(){
      try{
        const res = await  orderhotelService.getOrderHotel(this.opid);
        this.orderhotel = res.data;
      }catch (err) {
        pugMessage.error("服务器异常,代号：1025");
      }
    },

    // 1: 保存方法
    async saveorupdate() {
        try{
            // 校验
            const vresult = await this.validator();
            if(!vresult){
                return;
            }

            pugDialog.confirm('提示',"你确定进行【"+(this.orderhotel.id?'更新':'保存')+"】吗？").then(async ()=>{
                // 执行服务器数据保存酒店订单
                const res = await  orderhotelService.saveUpdateOrderHotel(this.orderhotel);
                if(res.status == 200){
                    if(isEmpty(this.orderhotel.id)){
                        // 重置数据
                        this.reset();
                        cache.local.remove("orderhotel_save");
                        // 返回列表
                        pugMessage.success("添加成功");
                        this.$router.push("/orderhotel/list");
                    }else{
                        cache.local.remove("orderhotel_save");
                        // 返回列表
                        pugMessage.success("修改成功");
                        this.$router.push("/orderhotel/list");
                    }
                }
            })
        }catch(err){
            pugMessage.error("服务器异常,代号：1025");
        }
    },

    // 2: 校验
    async validator(){

        if(isEmpty(this.orderhotel.orderno)){
           pugMessage.error("请输入订单编号 微信支付和阿里支付 用来退款");
           getById('orderno').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.userId)){
           pugMessage.error("请输入下单用户id");
           getById('userId').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.nickname)){
           pugMessage.error("请输入下单用户的昵称");
           getById('nickname').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.avatar)){
           pugMessage.error("请输入下单用户的头像");
           getById('avatar').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.status)){
           pugMessage.error("请输入订单状态 -1 失效的订单 0 未支付的订单 1 已支付 2已完成");
           getById('status').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.paymoney)){
           pugMessage.error("请输入下单金额");
           getById('paymoney').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelId)){
           pugMessage.error("请输入酒店id");
           getById('hotelId').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelImg)){
           pugMessage.error("请输入酒店封面");
           getById('hotelImg').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelTitle)){
           pugMessage.error("请输入酒店标题");
           getById('hotelTitle').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelDesc)){
           pugMessage.error("请输入酒店描述");
           getById('hotelDesc').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelDetailTitle)){
           pugMessage.error("请输入酒店房型标题");
           getById('hotelDetailTitle').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelDetailImg)){
           pugMessage.error("请输入酒店房型图标");
           getById('hotelDetailImg').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelDetailId)){
           pugMessage.error("请输入酒店房型id");
           getById('hotelDetailId').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.tradeno)){
           pugMessage.error("请输入交易号，微信支付和阿里支付 方便退款");
           getById('tradeno').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.openid)){
           pugMessage.error("请输入单金额");
           getById('openid').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.ip)){
           pugMessage.error("请输入支付IP地址");
           getById('ip').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.ipaddress)){
           pugMessage.error("请输入支付用户的IP具体地址");
           getById('ipaddress').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.paytype)){
           pugMessage.error("请输入支付方式 1 微信支付 2 支付支付 3 待定");
           getById('paytype').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelAddress)){
           pugMessage.error("请输入酒店地址");
           getById('hotelAddress').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelTel)){
           pugMessage.error("请输入酒店联系方式");
           getById('hotelTel').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelLgt)){
           pugMessage.error("请输入酒店经度");
           getById('hotelLgt').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.hotelLan)){
           pugMessage.error("请输入酒店纬度");
           getById('hotelLan').focus();
           return false;
        }

        if(isEmpty(this.orderhotel.isdelete)){
           pugMessage.error("请输入");
           getById('isdelete').focus();
           return false;
        }

        return true;
    },

    // 3: 步骤分解
    prev(index) {
      this.currentStep = index;
    },

    next(index) {
      this.currentStep = index;
    },

    // 4: 文件上传回调
    uploadSuccess(response) {
      console.log("uploadSuccess:", response)
    },

    // 5: 重置数据
    reset(){
        this.orderhotel = {
         citems: [{text:"请选择",value:""}],
         id:"", // 主健
         orderno:"", // 订单编号 微信支付和阿里支付 用来退款
         userId:"", // 下单用户id
         nickname:"", // 下单用户的昵称
         avatar:"", // 下单用户的头像
         status:"", // 订单状态 -1 失效的订单 0 未支付的订单 1 已支付 2已完成
         paymoney:"", // 下单金额
         hotelId:"", // 酒店id
         hotelImg:"", // 酒店封面
         hotelTitle:"", // 酒店标题
         hotelDesc:"", // 酒店描述
         hotelDetailTitle:"", // 酒店房型标题
         hotelDetailImg:"", // 酒店房型图标
         hotelDetailId:"", // 酒店房型id
         tradeno:"", // 交易号，微信支付和阿里支付 方便退款
         openid:"", // 单金额
         ip:"", // 支付IP地址
         ipaddress:"", // 支付用户的IP具体地址
         paytype:"", // 支付方式 1 微信支付 2 支付支付 3 待定
         hotelAddress:"", // 酒店地址
         hotelTel:"", // 酒店联系方式
         hotelLgt:"", // 酒店经度
         hotelLan:"", // 酒店纬度
         isdelete:"" //
       }
    },


  }
}
</script>
<style scoped="">
</style>
